class UserProfile {
  final String id;
  final String username;
  String? nickname;
  String? phone;
  String? email;
  String? avatar;

  UserProfile({
    required this.id,
    required this.username,
    this.nickname,
    this.phone,
    this.email,
    this.avatar,
  });

  factory UserProfile.fromJson(Map<String, dynamic> json) => UserProfile(
        id: json['id'],
        username: json['username'],
        nickname: json['nickname'] ?? '',
        phone: json['phone'] ?? '',
        email: json['email'] ?? '',
        avatar: json['avatar'] ?? '',
      );

  Map<String, dynamic> toJson() => {
        'id': id,
        'username': username,
        'nickname': nickname,
        'phone': phone,
        'email': email,
        'avatar': avatar,
      };
}
